home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1138 / source.zip / ERROR.C < prev    next >
C/C++ Source or Header  |  1995-01-18  |  1KB  |  38 lines

  1. /*      error.c -- Handle and log assertions
  2.     This file is part of Paperboy, an offline mail/newsreader for Windows
  3.     Copyright (C) 1995  Michael H. Vartanian
  4.         vart@clark.net
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; either version 2 of the License, or
  9.     (at your option) any later version.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #include <stdio.h>
  21. #include "soup.h"
  22. #include "error.h"
  23.  
  24. void logassert(const char * assertion, const char * filename, const int lineno)
  25. {
  26.     FILE * flog;
  27.  
  28. /*    fprintf(stderr,"ASS\n"); */
  29.     flog=fopen(LOGFILE,"a");
  30.     if (flog!=NULL)    /* If we can't open log file, we give up all hope */
  31.     {
  32.     fprintf(flog,"%s, %s:%d\n",assertion,filename,lineno);
  33.     fflush(flog);
  34.     fclose(flog);
  35.     }
  36. }
  37.  
  38.